home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Graphics / QuickDraw GX / GX->PostScript Sample / GXToPostScript / Internal Headers / FontHandler.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.9 KB  |  91 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        FontHandler.h
  3.  
  4.      Contains:    QuickDraw GX to PostScript conversion code.
  5.                          File contains data structures and definitions for the font database.
  6.  
  7.  
  8.      Version:    Technology:    Quickdraw GX 1.1.x
  9.       
  10.      Copyright:    © 1991-1997 by Apple Computer, Inc., all rights reserved.
  11. */
  12.  
  13. #ifndef __FONTHANDLER__
  14. #define __FONTHANDLER__
  15.  
  16. #ifndef __FONTDBASEHANDLER__
  17. #include "FontDatabase.h"
  18. #endif
  19.  
  20. #include <GXFonts.h>
  21. #include "GXToPSBuildConfig.h"
  22. #include "GXPrintingUniverse.h"
  23.  
  24. typedef void *TFontHandlerContext;
  25. typedef void *fhFont;
  26.  
  27. typedef enum {
  28.  
  29.     fhNoChange =                0,                                                    // Did nothing do effect save levels.
  30.     fhDidSave =                    1,                                                    // Added a save-level. Client should note graphics state.
  31.     fhDidRestore =            2,                                                    // restored to saved level.    Client should regenerate grahics state.
  32.     fhDidRestoreSave =    (fhDidSave | fhDidRestore)    // restored and saved. Client should regenerate graphics state and note it.
  33.  
  34. } TFHSaveResults;
  35.  
  36. typedef long TFHSaveResult;
  37.  
  38. typedef enum {
  39.  
  40.     fhNoDownloadFlags = 0,                    // Nothing
  41.     fhDownloadAscii = 1,                        // Must download using 7-bit clean data.
  42.     fhUseTypeZeroFonts = 2                    // Use Type-0 (composite) fonts if necessary.
  43.  
  44. } TFHDownloadFlag;
  45.  
  46. typedef long TFHDownloadFlags;
  47.  
  48.  
  49. #define fhTextDataTag     'fhtd'
  50. #define fh1or2byteTag      'fh12'
  51.  
  52.  
  53.  
  54.  
  55. /************************ Prototypes ************************/
  56.  
  57.  
  58. OSErr FontHandlerInit(TFontHandlerContext *context, CGXtoPostScriptDevice *psDevice, TFontDbase docFontDbase, scalerStreamTypeFlag legalStreamTypes, TFHDownloadFlags flags,
  59.                                                 unsigned char* version, unsigned char* revision, unsigned char* product);
  60.  
  61. OSErr FontHandlerShutdown(TFontHandlerContext context);
  62.  
  63. OSErr    FontHandlerLockContext(TFontHandlerContext context);
  64.                                                                                                                                         
  65. OSErr    FontHandlerUnlockContext(TFontHandlerContext context);
  66.  
  67. OSErr FontHandlerResolveShapeFonts(TFontHandlerContext context, gxShape theShape);
  68.  
  69. OSErr    FontHandlerMakeFontAvailable(TFontHandlerContext context, gxStyle theStyle, long *prFontIndex, unsigned char name[256], 
  70.                                                                                 TFHSaveResult *saveLevelResult);
  71.  
  72. OSErr FontHandlerDoDocumentHeader(TFontHandlerContext context);
  73.  
  74. #ifndef GXTOPOSTSCRIPTLIBRARY
  75.     OSErr    FontHandlerGetProcSetList(TFontHandlerContext context, gxProcSetListPtr procSetList, Boolean needsHex);
  76. #else
  77.     OSErr    FontHandlerDownloadProcSetList(CGXtoPostScriptDevice *psDevice);
  78. #endif
  79.  
  80. OSErr FontHandlerSetFontVM(TFontHandlerContext context, long fontVM);
  81.  
  82. OSErr FontHandlerBalanceSaveLevel(TFontHandlerContext context);
  83.  
  84. OSErr FontHandlerGetStyleFont(TFontHandlerContext context, gxStyle theStyle, fhFont *theFont);
  85.  
  86. OSErr FontHandlerGetStyleFontVariations(TFontHandlerContext context, gxStyle theStyle, long *count, gxFontVariation variations[]);
  87.  
  88. OSErr FontHandlerOutputVariationPSOperator(TFontHandlerContext context, gxStyle theStyle);
  89.  
  90. #endif
  91.